package com.runssnail.huafeiduo.api.request.phone;

import com.runssnail.huafeiduo.api.request.GetRequest;
import com.runssnail.huafeiduo.api.response.phone.OrderPhoneSubmitResponse;

import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;

/**
 * 检查当前订单状态（实时询问运营商），为了避免某些订单状态有疑问，提供此接口在于实时检查当前运营商返回订单状态。
 *
 * Created by zhengwei on 2016/3/31.
 */
public class OrderPhoneStatusRequest extends GetRequest<OrderPhoneSubmitResponse> {

    /**
     * 内部订单号
     */
    private String spOrderId;

    /**
     *
     * @param spOrderId 内部订单号
     */
    public OrderPhoneStatusRequest(String spOrderId) {
        this.spOrderId = spOrderId;
    }

    @Override
    public String getApiUrl() {
        return "http://api.huafeiduo.com/gateway.cgi?mod=order.phone.status";
    }

    @Override
    public Map<String, Object> getParams() {

        SortedMap<String, Object> params = new TreeMap<>();

        params.put("sp_order_id", this.spOrderId);

        return params;
    }

    @Override
    public Class<OrderPhoneSubmitResponse> getResponseClass() {
        return OrderPhoneSubmitResponse.class;
    }
}
